#ifndef SCALEWIDGET_H
#define SCALEWIDGET_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include <QPolygon>
#include <QImage>
#include <QTimer>
#include <qmath.h>
#include <QLinearGradient>
#include <QPainterPath>

#define SCALENUM  10
#define SCALECLR QColor(0,185,254)
namespace Ui {
class ScaleWidget;
}

class ScaleWidget : public QWidget
{
    Q_OBJECT

public:
    explicit ScaleWidget(QWidget *parent = 0);
    ~ScaleWidget();
    void paintEvent(QPaintEvent*);
    void setTargetDistance(float distance);
    void setTargetSpeed(float speed);
    void setStandByMode(bool set_mode);
    void setDistanceColor(float tar_speed,float tar_distance);
private:
    Ui::ScaleWidget *ui;
private:
    void drawScales(QPainter *painter);
    QList<float> m_ScaleValueList;
    QColor target_distance_bar_color;
    QColor target_distance_num_color;
    QColor target_speed_num_color;
    float m_targetDistance;
    float m_targetSpeed;
    inline float Ypos(uint8_t index);
};

#endif // SCALEWIDGET_H
